www.gusucode.com > 6KBBS ASP版 V7.1 > 6KBBS ASP版 V7.1\code\bbs\Main.asp

    <!--#include file="up.asp"--><!--#include file="inc/grade.asp"-->
<SCRIPT>var checktj;checktj=1;function tj0(){if(onlinetj.style.display==""){onlinetj.style.display = "none";}else{onlinetj.style.display="";if (checktj==1){tj.location="online.asp?onlinetj=index";}checktj=2;}}</SCRIPT>
<%
dim newuser,maxonline,maxontime,onnum1,onnum,paper,papern,papers,realnowtime,nowtime,nowon


response.write"<script type=""text/javascript"">messages = new Array();"
papern=0
set papers=conn.execute("select*from paper where bd=0 order by id desc")
	if papers.eof then%>
	messages[0]="&nbsp;当前没有公告"
	<%
	else
		do while not papers.eof
		paper=papers("paper")
		paper=split(paper,"|")%>
		messages[<%=papern%>]="&nbsp;<a href=# onclick=openscript('paper.asp?id=<%=papers("id")%>')><%=checktitle(lefttrue(paper(0),25))%> <span class=indexadtime>[ <%=paper(2)%> ]</span></a>";
		<%papern=papern+1
		papers.movenext
		loop
	end if
set papers=nothing
response.write"</script>"
Response.Write"<div id=content class=indexad></div><SCRIPT>jspaper();</SCRIPT>"
if isnull(lguserid) or lguserid="" then
	response.write"<div class=indexlogin><div class=indexlogintitle>用户登陆</div><div class=indexloginbody><form method=POST action=login.asp?action=login><p style='margin:4px;'>用户名:<input style='width:70;' name=lgname>&nbsp; 密 码:<input type=password  style='width:70;' name=lgpwd> 验证码:<input size=4 name=adminid maxlength=4>&nbsp;<img src=code.asp></p><p style='margin:4px;'>记&nbsp;&nbsp;&nbsp;录:<select name=cook style='width:70;'><option value=0>不保存</option><option value=1>保存一天</option><option value=30>保存一月</option><option value=365>保存一年</option></select>&nbsp; 方 式:<select style='width:70;' size='1' name='lgtype'><option selected value=1>正常</option><option value=2>隐身</option></select> &nbsp;<input type=submit value=' 登  陆 ' name=Submit></p></form></div></div>"
else
	response.write"<div class=indexlogined><a href='userinfo.asp?userid="&lguserid&"'><span class=indexinfonewuser>"&checktitle(lgname)&"</span></a> [ "&gradename(session(prefix&"usergrade"))&" ]<br><a href=Userinfo.asp?userid="&lguserid&">我的页面</a>, <a href=Otherlist.asp?action=mytop>我的发表</a>, <a href=Otherlist.asp?action=withmetop>我的参与</a>, <a href=sms.asp>我的留言板</a>(<span class=indexinfofont>"&newnum&"</span>)</div>"
end if

set rs=conn.execute("select maxonline,maxtopic,maxontime,nowtime,todaynum,topicnum,allnum,usernum,newuser from config")
newuser=rs("newuser")
newuser=split(newuser,"|")
maxonline=rs("maxonline")
maxontime=rs("maxontime")
realnowtime=formatdatetime(now()+timeset/24,2)
nowtime=replace(rs("nowtime"),",","")
if nowtime<>realnowtime then
conn.execute("update bdinfo set todaynum=0")
conn.execute("update config set todaynum=0,nowtime='"&realnowtime&"'")
end if
response.write"<div class=indexinfo><div class=indexinfotitle>论坛信息</div><div class=indexinfobody>共有 <span class=indexinfofont>"&rs("usernum")&"</span> 位会员 , 欢迎新会员:<a href='userinfo.asp?userid="&newuser(0)&"'><span class=indexinfonewuser>"&checktitle(newuser(1))&"</span></a><br>主题:<span class=indexinfofont>"&rs("topicnum")&"</span> 篇 , 帖子:<span class=indexinfofont>"&rs("allnum")&"</span> 篇 / 今日:<span class=indexinfofont>"&rs("todaynum")&"</span> 篇 , 最高记录:<span class=indexinfofont>"&rs("maxtopic")&"</span> 篇</div></div>"
set rs=nothing

dim rs1,lasttopic,lastinfo
set rs=conn.execute("select * from bdinfo where followid=0 order by orders desc,id")
	do while not rs.eof
		response.write"<div class=bbsbigname><A onclick=showtb("&rs("id")&")><SPAN style='CURSOR: pointer'><img src="&styleid&"/fl.gif border=0></SPAN></A> "&rs("bdinfo")&"</div>"
		
		response.write"<div id=tbtype"&rs("id")&" class=bbstypebody>"
		set rs1=conn.execute("select * from bdinfo where followid="&rs("id")&" order by orders desc,id")
			do while not rs1.eof
				bdinfo=rs1("bdinfo")
				bdinfo=split(bdinfo,"|")
				
				lasttopic=rs1("lasttopic")
				
				if isnull(lasttopic) or lasttopic=""  then
					lastinfo="本版面还没有帖子!"
				elseif rs1("type")=3 or rs1("type")=4 then
					lastinfo="vip或认证版面,数据不对外公开"
				else
					lasttopic=split(lasttopic,"|")
					lastinfo="作者:<A href=userinfo.asp?userid="&lasttopic(0)&">"&checktitle(lasttopic(1))&"</A> <BR>时间:"&lasttopic(2)&"<BR>主题:<IMG src=images/face/"&lasttopic(4)&".gif align=middle> <A href=showbbs.asp?bd="&rs1("id")&"&id="&lasttopic(5)&"&totable="&lasttopic(6)&"&page="&lasttopic(7)&">"&checktitle(lasttopic(3))&"</A>"
				end if
				
				
				response.write"<div class=bd><div class=bdpic><img border=0 src="&styleid&"/type"&rs1("type")&".gif></div><div class=bdcenter><div class=bdname><a href=Topiclist.asp?bd="&rs1("id")&">"&bdinfo(0)&"</a></div>"
				if isnull(bdinfo(2)) or bdinfo(2)="" then
				else
					response.write"<div class=bdlogo><img border=0 src="&bdinfo(2)&"></div>"
				end if	
				
				response.write"<div class=bdintro>"&bdinfo(1)&"</div>"
							
				if isnull(rs1("admin")) or rs1("admin")="" then
					response.write"<div class=bdadmin>本版面还没有版主</div>"
				else
					response.write"<div class=bdadmin>本版版主:"&replace(checktitle(rs1("admin")),"|","&nbsp; ")&"</div>"
				end if
				
				
				response.write"</div>"
				


				response.write"<div class=bdright><div class=bdtopicnum>话题数:"&rs1("topicnum")&"&nbsp;&nbsp;&nbsp; 今日帖数:<font color=red>"&rs1("todaynum")&"</font></div><div class=bdlastinfo>"&lastinfo&"</div></div>"
				
				response.write"</div>"
				rs1.movenext
			Loop
		rs1.Close
		set rs1=nothing
		
		response.write"</div>"
		rs.movenext
	Loop
rs.Close
set rs=nothing

if isnull(lguserid) or lguserid="" then
if conn.execute("select userid from online where ip='"&ip&"'").eof then
sql="insert into online(ip,lasttime,onbd) values('"&ip&"',now(),0)"
else
sql="update online set userid=0,name='',lasttime=now(),pic=0,onbd=0,nowon='' where ip='"&ip&"'"
end if
else
if conn.execute("select userid from online where userid="&lguserid&" or ip='"&ip&"'").eof then
sql="insert into online(userid,name,ip,lasttime,pic,onbd) values("&lguserid&",'"&lgname&"','"&ip&"',now(),"&usertype&",0)"
else
sql="update online set userid="&lguserid&",name='"&lgname&"',ip='"&ip&"',lasttime=now(),pic="&usertype&",onbd=0,nowon='' where ip='"&ip&"' or userid="&lguserid&""
end if
end if
conn.execute(sql)

	conn.execute("delete*from online where now()-lasttime>"&onlinetime&"/24")
	dim sql
	sql="select*from online order by userid desc"
	set rs = server.createobject("adodb.recordset")
	rs.Open sql,conn,1
	onnum=rs.recordcount
	onnum=conn.execute("select count(userid) from online")(0)
	if int(onnum)>=int(maxonline) then
		conn.execute("update [config] set maxonline="&onnum&",maxontime=now+"&timeset&"/24")
		maxonline=onnum
		maxontime=now+timeset/24
	end if
	onnum1=conn.execute("select count(userid) from online where userid=0")(0)

	response.write"<div class=onlinediv><div class=onlinetitle>在线统计 [ <a onclick=tj0()><SPAN style='CURSOR: pointer'>详细列表</span></a> ]</div><div class=onlinebody>目前论坛总共有 <b>"&onnum&"</b> 人在线,其中 <b>"&onnum-onnum1&"</b> 位会员,<b>"&onnum1&"</b> 位游客,最高峰在线:<b>"&maxonline&"</b> 人。&nbsp;发生在:"&maxontime&"</div><div class=onlinepeople id=onlinetj style='display:none'><iframe name=tj marginwidth=3 marginheight=3 width=100% border=0 frameborder=0 height=80></iframe></div><div class=onlineintro>名单图例:<img border=0 src="&styleid&"/0.gif>游客 | <img border=0 src="&styleid&"/1.gif>会员 | <img border=0 src="&styleid&"/6.gif>隐士 | <img border=0 src="&styleid&"/2.gif>VIP 会员 | <img border=0 src="&styleid&"/3.gif>版主 | <img border=0 src="&styleid&"/4.gif>超级版主 | <img border=0 src="&styleid&"/5.gif>管理员 </div></div>"



response.write"<div class=bbslink><div class=bbslinktitle>论坛联盟</div><div class=bbslinkbody>"

if thebbslink="" then
	dim showlink,td
	set rs=conn.execute("select*from bbslink")
	td=1
	do while not rs.eof
	td=td+1
		if checknum(application(prefix&"bbslinktype"))=1 then
			showlink=rs("name")
		else
			showlink="<img src="&rs("picurl")&" border=0 width=88 height=31 border=0>"
		end if
		
		response.write"<div class=bbslm><a title='"&checktitle(rs("readme"))&"' target=_blank href='"&rs("url")&"'>"&showlink&"</a></div>"
		thebbslink2=thebbslink2&"<div class=bbslm><a title='"&checktitle(rs("readme"))&"' target=_blank href='"&rs("url")&"'>"&showlink&"</a></div>"
		if td>5 then response.write"<br>":td=1:thebbslink2=thebbslink2
		rs.movenext
	loop
	
	application(prefix&"thebbslink")=thebbslink2
	set rs=nothing
else
	response.write""&thebbslink&""
end if
response.write"</div></div>"
response.write"<div class=boardpic><img src="&styleid&"/type0.gif align=absMiddle border=0> 普通版面 &nbsp; <img src="&styleid&"/type1.gif align=absMiddle border=0> 会员版面 &nbsp; <img src="&styleid&"/type2.gif align=absMiddle border=0> 只读版面 &nbsp; <img src="&styleid&"/type3.gif align=absMiddle border=0> 认证版面 &nbsp; <img src="&styleid&"/type4.gif align=absMiddle border=0> Vip版面</div>"
call down
%>